package org.keyyond.ms.business.controller;

import javax.servlet.http.HttpServletRequest;

import org.keyyond.ms.business.service.MsBusinessMessageLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhuyong
 * @belong to Shccs
 * @date:2018-1-19(V1.0)
 * @date:2018-1-19(V1.0)
 * @version : V1.0
 */
@RequestMapping("sms")
@RestController
public class MsBusinessMessageLogController {
	 @Autowired
	 private MsBusinessMessageLogService messageLogService;
	 
	 /**
		 * 记录日志的方法
		 * 
		 * @author zhuyong
		 * @since 2018-1-19
		 * @category </br>记录日志的方法</br>
		 *           
		 * @param jsonStrjsonStr
		 *            | string | 必填  日志对象json字符串
		 * @return <b>{日志主键:成功},{fail:失败},{exception:异常}</br>
		 * @exception 
		 */
	 @RequestMapping(value="/addLog",method = RequestMethod.POST)
	 public String smsAddMessageLog(String param){
		 return messageLogService.addSmsMessageLog(param);
	 }
	 
	 /**
		 * 分页查询日志信息的方法
		 * 
		 * @author szhuyong
		 * @since 2018-1-19
		 * @category </br>分页查询日志信息的方法</br>
		 *           
		 * @param request
		 *            | HttpServletRequest | 必填  
		 * @param jsonStr
		 *            | string | 必填  日志对象json字符串
		 * @return <b>日志信息List集合Json字符串</br>
		 * @exception 
		 */
	 @RequestMapping(value="/getSmsLog",method = RequestMethod.POST)
	 public String smsGetMessageLog(HttpServletRequest request,String param){
		 return messageLogService.getSelectListByPage(request,param);
	 }
	 
	 /**
		 * 短信接口非法调用判断
		 * 
		 * @author YCR
		 * @since 2018-1-19
		 * @category </br>短信接口非法调用判断</br>
		 *           
		 * @param jsonStr
		 *            | string | 必填  手机号和验证码类型的json字符串
		 * @return <b>String</br>
		 * @exception 
		 */
	 @RequestMapping(value="/validateSmsInfo",method = RequestMethod.POST)
	 public String smsCanUserResetPassword(HttpServletRequest request,String param) {
		 return messageLogService.canUserResetPassword(request,param);
	 }
	 
}
